<%@ page language="java" pageEncoding="utf-8" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <title>springajax</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script>
       function t(){
           $.ajax({
               url:'/timer',
               type:'get',
               cache:false,
               dataType:'text',
               success:function(d){
                   $('#ttt').html(d);
               }
           })
       }

       function t(){
           $('#ttt').load('/timer');
       }

       $(function(){
           t();
           setInterval(t,1000);
       })

    </script>
</head>
<body>
<h3 id="ttt"></h3>
</body>
</html>